<?php
/**
* Author:陈明标
*/
namespace Home\Model;
use Think\Model\RelationModel;

class AdminDepartmentRelationModel extends RelationModel{

    Protected $tableName = 'admin';

    Protected $_link = array(
        'department' => array(
            'mapping_type' => self::BELONGS_TO,
            'mapping_name' => 'department',
            'foreign_key' => 'department_id',
            'mapping_fields' => 'name',
            'as_fields' => 'name:department_name'
        )

    );

}

?>